package history.study.array;

// 283. 移动零:https://leetcode-cn.com/problems/move-zeroes/
public class LeetCode_283 {
    public void moveZeroes(int[] nums) {
        if (nums == null || nums.length <=1) return;
        int length = nums.length;
        int slow = 0, fast = 0;
        while(fast < length) {
            if (nums[fast]!=0) {
                nums[slow++] = nums[fast];
            }
            fast++;
        }
        while (slow < length) {
            nums[slow++] = 0;
        }
    }
}
